
class Student(object):

    def __init__(self,name):
        self.name = name

    @property
    def fly(self):
        print(self.name,"is flying...")


s = Student("Jack")
# s.fly() # TypeError: 'NoneType' object is not callable
s.fly # OK

# class Flight(object):
#
#     def __init__(self,name):
#         self.flight_name = name
#
#     def checking_status(self):
#         print("connecting airline company/airport api...")
#         print("checking flight %s status"% self.flight_name)
#         return 1 # 1 arrrived , 2 departured , 3 canceled
#
#     @property
#     def flight_status(self):
#         status = self.checking_status()
#         if status == 0 :
#             print("flight got canceled...")
#         elif status == 1 :
#             print("flight is arrived...")
#         elif status == 2 :
#             print("flight has departured already...")
#         else :
#             print("can't confirm the flight status...please check later...")
#
#     @flight_status.setter # 对上面的静态方法的修改
#     def flight_status(self,status):
#         print("changing...flight status...",status)
#         self.status = status
#
#
#     @flight_status.deleter # 静态属性删除
#     def flight_status(self):
#         print("del ...")
#
# f = Flight("CA980")
# f.flight_status
# f.flight_status = 0
# print(f.status)
# print(f.flight_status)
#
# del f.flight_status  # AttributeError: can't delete attribute